package com.aaa.javaweb.servlet;

import com.aaa.javaweb.dao.GreXinXiDao;
import com.aaa.javaweb.until.LayTable;
import com.aaa.javaweb.until.TableLabe;
import com.aaa.javaweb.until.TransBean;
import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.naming.LimitExceededException;
import java.util.List;
import java.util.Map;

@Controller
public class Gerendingdan {
    @Autowired
    private GreXinXiDao greXinXiDao;
    @RequestMapping("gerendingdan")
    @ResponseBody
    public LayTable selectgerendingdna(String kid, Integer page, Integer limit){
        //客户查询自己的订单
        List<Map> maps=greXinXiDao.selectxinxi(kid,page,limit);
        //TableLabe tableLabe = new TableLabe(0, "", maps.size(), maps);
        int i=greXinXiDao.selectcount();
        LayTable layTable = new LayTable(i, maps);
        return layTable;
    }

   /* @RequestMapping("gerendingdans")
    @ResponseBody
    public TableLabe selectgerendingdnas(String kid){
        //客户查询自己的订单
        List<Map> maps=greXinXiDao.selectxinxis(kid);
        TableLabe aa = new TableLabe(0, "", maps.size(), maps);
        return aa;
    }*/



    @RequestMapping("gerendingdanqu")
    @ResponseBody
    public int selectgerendingdnaqu(String id){
        //客户取消自己的订单
        int i=greXinXiDao.updquxiao(id);

        return i;
    }
}
